home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / images2.pxl < prev    next >
Text File  |  2000-10-10  |  29KB  |  1,098 lines

  1. Initialize:
  2.     UseCoordinates(PIXEL) 
  3.     SetColorPalette(BITMAP)
  4.     Title$ = "PiXCL 5.0 Image Processing"
  5.     UseCaption(Title$)
  6.     UseBackground(TRANSPARENT,166,166,166)
  7.     DrawBackground
  8.     WinAdjustRect(50,100,880,635,MENU,wx1,wy1,wx2,wy2)
  9.     WinLocate(Title$,wx1,wy1,wx2,wy2,Res)  {100,100,880,635}
  10.     WinShow(Title$,TOPMOST,Res)
  11.     {AboutPiXCL}
  12.     ImageFile$ = ""
  13.     DirGet(SourceDir$)
  14.     
  15.     Image1$ = SourceDir$ + "\brsfbnd1.bmp"
  16.     Image2$ = SourceDir$ + "\brsfbnd2.bmp"
  17.     Image3$ = SourceDir$ + "\brsfbnd3.bmp"
  18.     Image4$ = SourceDir$ + "\brsfbnd4.bmp"
  19.     Image5$ = SourceDir$ + "\brsfbnd5.bmp"
  20.     Image7$ = SourceDir$ + "\brsfbnd7.bmp"
  21.     Image8$ = SourceDir$ + "\brsfc754.bmp"
  22.     Image9$ = SourceDir$ + "\brstclas.bmp"
  23.     Image10$ = SourceDir$ + "\brstgrid.bmp"
  24.     Image11$ = SourceDir$ + "\brstrans.bmp"
  25.     Image12$ = SourceDir$ + "\brstran1.bmp"
  26.  
  27.     UseFont("MS Sans Serif",0,19,NOBOLD,NOITALIC,NOUNDERLINE,255,0,0)
  28.     InitFile$ = "*.bmp"
  29.  
  30.     InfoMenu(REMOVE)
  31.     WaitInput(100)
  32.  
  33.     SetMenu("&File",IGNORE,
  34.         "&Raw Options",RawOptionsDlg,
  35.         "&Show Cmd Line",ShowCmdLine,
  36.         "E&xit!",Leave,
  37.         ENDPOPUP,
  38.         "&Image Info",IGNORE,
  39.         "&DropLoadImage",DropLoadImage,
  40.         "&Load Image",GetImageInfo,
  41.         "&Save Image",SaveImageInfo,
  42.         SEPARATOR,
  43.         "&Preview ImageBox",ShowPreviews,
  44.         SEPARATOR,
  45.         "&Histogram Test",MakeHistogram,
  46.         "&Update Histogram", Update_Histogram,
  47.         "&Remove Histogram",Remove_Histogram,
  48.         SEPARATOR,
  49.         "&Zooming",Zooming,
  50.         "&Roaming",Roaming,
  51.         SEPARATOR,
  52.         "Counting Colors",CountingTheColors,
  53.         SEPARATOR,
  54.         "List Bitmaps",CountTheList,
  55.         SEPARATOR,
  56.         "Help",HelpGetImageInfo,
  57.         ENDPOPUP,
  58.         "Compose BitMap",IGNORE,
  59.         "Show Channel Histograms",GetRGBchannels,
  60.         "Show Components",Components,
  61.         "Replace Channel",Replacer,
  62.         "Combine Channels",Combiner,
  63.         ENDPOPUP,
  64.         "Point Ops",IGNORE,
  65.         "Clear Window",Clear,
  66.         SEPARATOR,
  67.         "Clear All",ClearAll,
  68.         SEPARATOR, 
  69.         "Theme Overlays",OverlayThemes,
  70.         "Grid Overlays",OverlayGrids,
  71.         SEPARATOR,
  72.         "F/G Mode", SettingDrawMode,
  73.         "ReDraw Bkg", ReDrawingBkg,
  74.         "Draw Tr image",DrawTransparency,
  75.         "Transparency", Transparency,
  76.         SEPARATOR,
  77.         "Fast Classify",Fast_Classify,
  78.         "Remap Colors",ImageRemapper,
  79.         SEPARATOR,
  80.         "Scatter",DisplacePixels,
  81.         "Despeckle",Despecker,
  82.         "Tune Up",BrightnessContrastUp,
  83.         "Tune Down",BrightnessContrastDn,
  84.         "Equalize",Equalizer,
  85.         "Normalize",Normalizer,
  86.         "Normalize Range",NormalizerRange,
  87.         "Flip Image",FlipVertical,
  88.         "Mirror Image",FlipHorizontal,
  89.         "Negative",Inversion,
  90.         "Average",Averaging,
  91.         "Blur",Blurring,
  92.         "Gaussian Blur",GBlurring,
  93.         "Sharpen",Sharpening,
  94.         "Add Noise",Noisy,
  95.         SEPARATOR,
  96.         "Help",HelpPaint,
  97.         ENDPOPUP,
  98.         "F&ilters",IGNORE,
  99.         "&View Filter",View_Filter,
  100.         "&Create/Edit 5x5 Filter",MakeFilterMatrix,
  101.         "Filter 5x5",Do5xFilter,
  102.         "Filter 15x15",Do15xFilter,
  103.  
  104.         ENDPOPUP,
  105.         "Matrix Ops",IGNORE,
  106.         "Emboss",Embossing,
  107.         "EdgeDetect",EdgeDetect,
  108.         ENDPOPUP,
  109.         "Geometric Ops",IGNORE,
  110.         "Skew V",SkewerV,
  111.         "Skew H",SkewerH,
  112.         "Rotate",ImageRotation,
  113.         "RotateExt",ImageRotationExt,
  114.         SEPARATOR,
  115.         "Crop Image",Cropper,
  116.         "Resize", Resizer,
  117.         "Resample",Resampler,
  118.         ENDPOPUP,
  119.         "Color Space",IGNORE,
  120.         "RGB32  32-bit",Cspace1,
  121.         SEPARATOR,
  122.         "RGB24  24-bit",Cspace2,
  123.         "CIELAB  24-bit",Cspace9,
  124.         SEPARATOR,
  125.         "RGB555  16-bit",Cspace3,
  126.         "RGB565  16-bit",Cspace3a,
  127.         "GRAY16  16-bit",Cspace10,
  128.         SEPARATOR,
  129.         "INDEXED  8-bit",Cspace4,
  130.         "GRAYSCALE 8-bit",Cspace5,
  131.         SEPARATOR,
  132.         "MONO  1-bit",Cspace11,
  133.         ENDPOPUP,
  134.         "&About",AboutThisApp,
  135.         ENDPOPUP)
  136.     
  137.     StatusWindow(ENABLE,BOTTOM,4,290,390,490,-1)
  138.     GoSub Create_PiXCL_Toolwindow
  139.     
  140.  
  141.        Filter$ = "BMP files(*.bmp),*.bmp,JPG files(*.jpg),*.jpg,"
  142.     Filter$ = Filter$ + "PCD files(*.pcd),*.pcd,"
  143.     Filter$ = Filter$ + "PNG files(*.png),*.png,PCX files(*.pcx),*.pcx,"
  144.     Filter$ = Filter$ + "PSD files(*.psd),*.psd,RAS files(*.ras),*.ras,"
  145.     Filter$ = Filter$ + "TGA files(*.tga),*.tga,TIF files(*.tif),*.tif"
  146.  
  147.     UseBackground(TRANSPARENT,166,166,166)
  148.     DragAcceptFile(ENABLE,DragLoadImage)
  149.     GetCmdLine(Cmd$)
  150.     DrawBackground
  151.     GoSub  GetCmdArg
  152.     If ImageFile$ <> "" Then Goto ProcessImage
  153.  
  154. Wait_for_Input:
  155.     WaitInput()
  156.  
  157. Leave:
  158.     Histogram()
  159.     FreeBitmapAll
  160.     End
  161.  
  162.  
  163.  
  164. AboutThisApp:
  165.     AboutUser("Sample Program","","")
  166.     Goto Wait_for_Input
  167.  
  168. RawOptionsDlg:
  169.     DrawBackground
  170.     HelpInfo$ = 
  171. "Issues related to importing raw image data
  172. into a PiXCL application are:
  173.     band interleaved or band sequential;
  174.     if 16 bit, are the high bytes first or last;
  175.     i.e. bigendian or little endian;
  176.     should the bitmap be inverted on load.
  177. The bitmap is loaded into the PiXCL image list
  178. and can be displayed, processed and saved in the 
  179. usual way. The sample image about to be loaded 
  180. is 3-channel RGB, 128-byte header size."
  181.     RawImage$ = SourceDir$ + "\brsfc754.raw"  {500x406}
  182.  
  183.     RawImage$ = "D:\E18mp0911.i"
  184.  
  185.     UseFont("Arial",7,15,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
  186.     Xsize = 768   Ysize = 11000    Header = 512
  187.     RawDataParamBox(RawImage$,HelpInfo$,Xsize,Ysize,Samples,Bits, Header,Flags)
  188.     DrawText(10,40,"Xsize = ") DrawNumber(80,40,Xsize)  
  189.     DrawText(120,40,"Ysize = ") DrawNumber(190,40,Ysize)
  190.     DrawText(10,65,"Channels = ")  DrawNumber(120,65,Samples) 
  191.     DrawText(10,90,"Bits/Sample = ") DrawNumber(120,90,Bits)
  192.     DrawText(10,115,"Offset = ")  DrawNumber(120,115,Header)
  193.     DrawText(10,140,"Flags = ") DrawNumber(120,140,Flags)
  194.  
  195.     If Flags <> 0 
  196.         UseCursor(WAIT)
  197.         ReadRawBitmap(RawImage$,Xsize,Ysize,Samples,Bits, Header,Flags)
  198.         ImageFile$ = RawImage$
  199.         If Flags <> 0 Then DrawBitmap(30,38,ImageFile$)
  200.         UseCursor(ARROW)
  201.     Endif
  202.     Goto Wait_for_Input
  203.  
  204. View_Filter:
  205.     MTX_Filter$ = "All Filters (*.mtx),*.mtx"
  206.     Label$ = "Select a filter to view"
  207.     InitFile$ = "*.mtx"
  208.     FileGet(MTX_Filter$,InitFile$,SourceDir$,Label$,CHANGEDIR,Filter5x$)
  209.     If Filter5x$ <> ""
  210.         ViewFilterFile(Filter5x$)
  211.     Endif
  212.     Goto Wait_for_Input
  213.  
  214. MakeFilterMatrix:
  215.     MTX_Filter$ = "All Filters (*.mtx),*.mtx"
  216.     Label$ = "Select a filter to create or edit"
  217.     InitFilterFile$ = "*.mtx"
  218.     FileGet(MTX_Filter$,InitFilterFile$,SourceDir$,Label$,CHANGEDIR,Filter5x$)
  219.     If Filter5x$ <> ""
  220.         Create5x5Filter(Filter5x$,Res)
  221.     Endif
  222.     Goto Wait_for_Input
  223.  
  224. Do5xFilter:
  225.     WaitInput(1)
  226.     If ImageFile$ <> ""
  227.         If Filter5x$ = "" Then Filter5x$ = SourceDir$ + "\test5x.mtx"
  228.         UseCursor(WAIT)
  229.         FilterImage5x(Filter5x$,Res)
  230.          UseCursor(ARROW)
  231.         If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  232.     Endif
  233.     Filter5x$ = ""
  234.     Goto Wait_for_Input
  235.  
  236. Do15xFilter:
  237.     WaitInput(1)
  238.     If ImageFile$ <> ""
  239.         Filter15x$ = SourceDir$ + "\average.mtx"
  240.         UseCursor(WAIT)
  241.         FilterImage15x(Filter15x$,Res)
  242.         UseCursor(ARROW)
  243.         If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  244.     Endif
  245.     Goto Wait_for_Input
  246.  
  247. ShowCmdLine:
  248.     GetCmdLine(Cmd$)
  249.     MessageBox(OK,1,INFORMATION,Cmd$,"Command Line",Res)
  250.     Goto Wait_for_Input
  251.  
  252. GetCmdArg:
  253.     InStr(Cmd$," ",Loc)
  254.     If Loc = 0
  255.         ImageFile$ = "" 
  256.     Else
  257.         RightOf(Cmd$,Loc,ImageFile$)
  258.         StrRev(ImageFile$)
  259.         Trim(ImageFile$)
  260.         StrRev(ImageFile$)
  261.         InStr(ImageFile$,"pxl",Loc)
  262.         If Loc <> 0 Then ImageFile$ = ""
  263.     Endif
  264.     FreeVar(Cmd$)
  265.     Return
  266.  
  267. ShowPreviews:
  268.     If ImageFile$ <> "" Then ImageBox("Image #1",ImageFile$,"image #1","OK","Cancel",Btn)
  269.     Goto Wait_for_Input
  270.  
  271. CountingTheColors:
  272.     CountBitmapColors(ImageFile$,Colors)
  273.     If Colors <> 0
  274.         Str(Colors,Colors$)
  275.         Msg$ = "Number of unique colors in this image = " + Colors$
  276.         MessageBox(OK,1,INFORMATION,Msg$,ImageFile$,Res)
  277.     Endif
  278.     Goto Wait_for_Input
  279.  
  280. CountTheList:
  281.     Chr(13,CR$)
  282.     ListLoadedBitmaps(List$,CR$,Count)
  283.     If List$ = "" Then List$ = "No images loaded."
  284.     Str(Count,Count$)
  285.     Msg$ = "Entries in PiXCL Bitmap List = " + Count$
  286.     MessageBox(OK,1,INFORMATION,List$,Msg$,Res)
  287.     Goto Wait_for_Input
  288.  
  289. OverlayThemes:
  290.     If ImageFile$ = "" Then Beep Goto Wait_for_Input
  291.     WaitInput(1)
  292.     LoadBitmap(Image9$,FULL) 
  293.     DrawBitmap(30,38,ImageFile$)
  294.     OverlayImage(Image9$, 0,0,0, Res)
  295.     If Res = 0 
  296.         MessageBox(OK,1,INFORMATION,"Overlay failed","DEBUG",Res)
  297.     Endif
  298.     GetBitMapDim(ImageFile$,Lines,Pixels,Bits)
  299.     DrawBitmap(30,38,ImageFile$) 
  300.     Goto Wait_for_Input
  301.  
  302. OverlayGrids:
  303.     If ImageFile$ = "" Then Beep Goto Wait_for_Input
  304.     WaitInput(1)
  305.     LoadBitmap(Image10$,FULL)
  306.     DrawBitmap(30,38,ImageFile$)
  307.     OverlayImage(Image10$, 255,255,255, Res)
  308.     If Res = 0 
  309.         MessageBox(OK,1,INFORMATION,"Overlay failed","DEBUG",Res)
  310.     Endif
  311.     GetBitMapDim(ImageFile$,Lines,Pixels,Bits)
  312.     DrawBitmap(30,38,ImageFile$) 
  313.     Goto Wait_for_Input
  314.  
  315. SettingDrawMode:
  316.     MessageBox(YESNOCANCEL,1,QUESTION,
  317.     "Yes = FOREGND, No = BCKGND, Cancel = BOTH",
  318.     "Setting Draw Mode",Res)
  319.  
  320.     If Res = 1 Then SetDrawMode(FOREGND)
  321.     If Res = 2 Then SetDrawMode(BACKGND)
  322.     If Res = 3 Then SetDrawMode(BOTH)
  323.  
  324.     Goto Wait_for_Input
  325.  
  326. ReDrawingBkg:
  327.     ReDraw
  328.     Goto Wait_for_Input
  329.  
  330. DrawTransparency:
  331.     DrawBitmap(30,38,Image9$)
  332.     Goto Wait_for_Input
  333.  
  334.  
  335. Transparency:
  336.     WaitInput(1)
  337.     GetBitmapDim(Image12$,Lines,Pixels,Bits)
  338.     nx = 30   ny = 30
  339.     DrawBitmap(30,38,Image9$)
  340.      SetDrawMode(FOREGND)
  341.  
  342.     For xx = 0 To 40
  343.         {draw the foreground graphics}
  344.         DrawTrBitmap(nx,ny,Image12$,0,0,0)
  345.         nx2 = nx + Pixels    
  346.         ny2 = ny + Pixels
  347.         nx += 5       ny++
  348.        {update the background buffer}
  349.         SetDrawMode(BACKGND)
  350.         DrawTrBitmap(nx,ny,Image12$,0,0,0)
  351.         WaitInput(1)
  352.         DrawBackgroundRegion(nx,ny,nx2,ny2)
  353.         DrawBitmap(30,38,Image9$)
  354.         SetDrawMode(FOREGND)
  355.     Next
  356.     Goto Wait_for_Input
  357.  
  358.  
  359. Roaming:
  360.     If ImageFile$ <> ""
  361.         ZoomFactor = 4
  362.         X2 = 30 + Pixels
  363.         Y2 = 30 + Lines
  364.         X3 = X2 + 20
  365.         X4 = X3 + 60
  366.         Pix = Pixels/2
  367.         Piy = Lines/2
  368.         DrawZoomedBitmap(30,38,X2,Y2,ImageFile$,Pix,Piy,ZoomFactor)
  369.         SetCtrlMouse(30,38,X2,Y2,PosRoam,Px,Py)
  370.         SetShftRightMouse(30,38,X2,Y2,NegRoam,Px,Py)
  371.     Endif
  372.     Goto Wait_for_Input
  373.  
  374. PosRoam:
  375.     If ImageFile$ <> ""
  376.         Pix = Px - 30
  377.         DrawZoomedBitmap(30,38,X2,Y2,ImageFile$,Pix,Piy,ZoomFactor)
  378.     Endif
  379.     Goto Wait_for_Input
  380.  
  381. NegRoam:
  382.     If ImageFile$ <> ""
  383.         ZoomFactor = 4
  384.         Pix = 100
  385.         While Pix < 350
  386.             DrawZoomedBitmap(30,38,X2,Y2,ImageFile$,Pix,Piy,ZoomFactor)
  387.             Pix += 2
  388.         EndWhile
  389.         SetShftRightMouse()
  390.     Endif
  391.     Goto Wait_for_Input
  392.  
  393. Zooming:
  394.     ZoomFactor = 1
  395.     X2 = 30 + Pixels
  396.     Y2 = 30 + Lines
  397.     X3 = 537
  398.     X4 = X3 + 60
  399.     Pix = Pixels/2
  400.     Piy = Lines/2
  401.     DrawZoomedBitmap(30,38,X2,Y2,ImageFile$,Pix,Piy,ZoomFactor)
  402.     SetMouse(30,38,X2,Y2,PosZoom,Px,Py)
  403.     SetRightMouse(30,38,X2,Y2,NegZoom,Px,Py)
  404.     UseBackground(OPAQUE,192,192,192)
  405.     UsePen(SOLID,1,0,0,0)
  406.     UseBrush(SOLID,0,0,0)
  407.     WaitInput()
  408.  
  409. PosZoom:
  410.     If ImageFile$ <> ""
  411.        ZoomFactor++
  412.        If ZoomFactor > 16 Then ZoomFactor = 16
  413.        DrawText(X3,410,"Zoom             ")
  414.        DrawNumber(X4,410,ZoomFactor)
  415.        Px -= 30   Py = Lines - Py   Py += 30 
  416.        DrawZoomedBitmap(30,38,X2,Y2,ImageFile$,Px,Py,ZoomFactor)
  417.     Endif
  418.     Goto Wait_for_Input
  419.  
  420. NegZoom:
  421.     If ImageFile$ <> ""
  422.         ZoomFactor--
  423.        If ZoomFactor < 1 Then ZoomFactor = 1
  424.        DrawText(X3,410,"Zoom             ")
  425.        DrawNumber(X4,410,ZoomFactor)
  426.        Px -= 30   Py = Lines - Py   Py += 30 
  427.        DrawZoomedBitmap(30,38,X2,Y2,ImageFile$,Px,Py,ZoomFactor)
  428.     Endif
  429.     Goto Wait_for_Input
  430.  
  431. DropLoadImage:
  432.     DFServer = 1
  433.     Goto GetImageInfo
  434. DragLoadImage:
  435.     GetDragList(ImageFile$)
  436.     Goto ProcessImage
  437.  
  438. GetImageInfo:
  439.     DrawBackGround
  440.     SetMouse()
  441.     SetRightMouse()
  442.     Histogram()
  443.     WaitInput(1)
  444.     If ImageFile$ <> "" Then FreeBitMap(ImageFile$)
  445.     FileGet(Filter$, InitFile$, "",
  446.         "Select an image to load",CHANGEDIR,ImageFile$)
  447.     If ImageFile$ = "" Then Goto Wait_for_Input
  448.     
  449. ProcessImage:
  450.     If DFServer <> 1
  451.     FileExtension(ImageFile$,Ext$,Res)
  452.     InitFile$ = "*." + Ext$
  453.     Ext$ = Ext$ + " Image File Format Read"
  454.     GetBitMapDim(ImageFile$,Lines,Pixels,Bits)
  455.     DrawBackGround
  456.     DrawText(25,0,Ext$)
  457.     DrawText(560,30,"Lines") DrawNumber(660,30,Lines)
  458.     DrawText(560,50,"Pixels") DrawNumber(660,50,Pixels)
  459.     DrawText(560,70,"Bits") DrawNumber(660,70,Bits)
  460.  
  461.     If Bits <> 0
  462.         sx1 = 27  sy1 =35
  463.         sx2 = 33 + Pixels    sy2 = 41 + Lines
  464.         DrawEdgeRectangle(sx1,sy1,sx2,sy2,SUNKENEDGE,ADJUST,RECT)
  465.         DrawBitmap(30,38,ImageFile$)
  466.  
  467.     SetCurrentBitmap(ImageFile$, FULL,BitmapHandle)
  468.     Histogram(600,40,POPUP,ImageFile$, BitmapHandle ,NONCUM,"",HistID)
  469.  
  470.  
  471.     Endif
  472.  
  473.     Else
  474.         DropFileServer(ENABLE,ImageFile$)
  475.         WinGetClientRect("",cx1,cy1,cx2,cy2)
  476.         SetMouse(cx1,cy1,cx2,cy2,EndDFS,n,n)
  477.     Endif
  478.     Goto Wait_for_Input
  479.  
  480. EndDFS:
  481.     SetMouse()
  482.     UseCaption(Title$)
  483.     DFServer = 0
  484.     Goto Wait_for_Input
  485.  
  486.  
  487. SaveImageInfo:
  488.     FileSaveAs(Filter$, InitFile$, "",
  489.         "Select save image Filename",CHANGEDIR,ImageFile$)
  490.     If ImageFile$ = "" Then Goto Wait_for_Input
  491.     SaveBitmap(ImageFile$,Res)
  492.  
  493.     Goto Wait_for_Input
  494.  
  495. UndoLastOperation:
  496.     WaitInput(1)
  497.     If ImageFile$ <> ""
  498.         FreeBitmap(ImageFile$)
  499.         sx1 = 27  sy1 =35
  500.         sx2 = 33 + Pixels    sy2 = 41 + Lines
  501.         DrawEdgeRectangle(sx1,sy1,sx2,sy2,SUNKENEDGE,ADJUST,RECT)
  502.         DrawBitmap(30,38,ImageFile$)
  503.     Endif
  504.     Goto Wait_for_Input
  505.  
  506.  
  507. GetRGBchannels: {shows the HANDLE of each channel in an image.}
  508.     GetChannel(RED,RedHandle)
  509.     GetChannel(GREEN,GreenHandle)
  510.     GetChannel(BLUE,BlueHandle)
  511.  
  512.     {now create the histograms}
  513.     Histogram(530,100,POPUP, RedHandle,NONCUM,"Red",Histogram1,
  514.          530,260,POPUP, GreenHandle,NONCUM,"Green",Histogram2,
  515.           530,420,POPUP, BlueHandle,NONCUM,"Blue", Histogram3)
  516.  
  517.     Goto Wait_for_Input
  518.  
  519.  
  520. Components: {draw all the test images}
  521.     DrawBackGround
  522.     DrawSizedBitMap(30,38,100,100,Image1$)  SetCurrentBitmap(Image1$, FULL,Band1Handle)
  523.     DrawSizedBitMap(30,38,100,100,Image2$)  SetCurrentBitmap(Image2$, FULL,Band2Handle)
  524.     DrawSizedBitMap(30,38,100,100,Image3$)  SetCurrentBitmap(Image3$, FULL,Band3Handle)
  525.     DrawSizedBitMap(30,38,100,100,Image4$)  SetCurrentBitmap(Image4$, FULL,Band4Handle)
  526.     DrawSizedBitMap(30,38,100,100,Image5$)  SetCurrentBitmap(Image5$, FULL,Band5Handle)
  527.     DrawSizedBitMap(30,38,100,100,Image7$)  SetCurrentBitmap(Image7$, FULL,Band7Handle)
  528.  
  529.     GetBitMapDim(Image8$,Lines,Pixels,Bits)
  530.     If Bits <> 0
  531.         sx1 = 27  sy1 = 35
  532.         sx2 = 33 + Pixels    sy2 = 41 + Lines
  533.         DrawEdgeRectangle(sx1,sy1,sx2,sy2,SUNKENEDGE,ADJUST,RECT)
  534.         DrawBitmap(30,38,Image8$)
  535.     Endif
  536.     DrawBitmap(30,38,Image8$) SetCurrentBitmap(Image8$, FULL,Band8Handle)
  537.     GetChannel(RED,RedHandle)
  538.     GetChannel(GREEN,GreenHandle)
  539.     GetChannel(BLUE,BlueHandle)
  540.  
  541.     ImageFile$ = Image8$
  542.  
  543.     Goto Wait_for_Input
  544.  
  545. Replacer:
  546.     SetEditControl()
  547.     WaitInput(1)
  548.     ImageFile$ = Image8$
  549.     DrawBitmap(30,38,ImageFile$)
  550.     TuneImage(0,0,0,0,0,0,Band8Handle)
  551.     Channel$ = "0"  Band$ = "1"
  552.  
  553.     SetEditControl(550,50,600,75,NUMBERUD,2,0,Channel$,
  554.                550,85,600,110,NUMBERUD,7,1,Band$)
  555.     DrawText(630,50,"Image Channel")
  556.     DrawText(630,85,"Replace with")
  557.     Button(550,130,620,150,PUSH,"&Replace",Replacer_R,
  558.            550,160,620,180,PUSH,"&Done",Replacer_D,
  559.            530,10,750,200,GROUP,"Replace Channel",Replacer_R,
  560.  
  561.            550,260,700,285,AUTORADIO,"Red Channel",Replacer_R,
  562.            550,300,700,325,AUTORADIO,"Green Channel",Replacer_R,
  563.            550,340,700,365,AUTORADIO,"Blue Channel",Replacer_R,
  564.            530,230,750,400,GROUP,"Classify",Replacer_R) 
  565.     
  566.     DrawStatusWinText(0,ImageFile$)
  567.     GetBitmapDim(ImageFile$,Lines, Pixels,Bits)
  568.     Str(Lines,Lines$) Lines$ = "Lines=" + Lines$
  569.     Str(Pixels,Pixels$) Pixels$ = "Pixels=" + Pixels$
  570.     Str(Bits,Bits$) Bits$ = "Bits/Pixel=" + Bits$
  571.     DrawStatusWinText(1,Lines$)
  572.     DrawStatusWinText(2,Pixels$)
  573.     DrawStatusWinText(3,Bits$)
  574.     WaitInput()
  575.  
  576. Replacer_R:
  577.     Val(Channel$,Channel,Res)
  578.     Val(Band$,Band,Res)
  579.     If Band = 1 Then NewHandle = Band1Handle
  580.     If Band = 2 Then NewHandle = Band2Handle
  581.     If Band = 3 Then NewHandle = Band3Handle
  582.     If Band = 4 Then NewHandle = Band4Handle
  583.     If Band = 5 Then NewHandle = Band5Handle
  584.     If Band = 7 Then NewHandle = Band7Handle
  585.  
  586.  
  587.     ReplaceChannel(Band8Handle,NewHandle,Channel,Res)
  588.     If Res = 0 Then MessageBox(OK,1,INFORMATION,"Replace Channel failed","",Res)
  589.     DrawBitmap(30,38,ImageFile$)
  590.     Goto Wait_for_Input
  591.  
  592. Replacer_D:
  593.     SetEditControl()
  594.     Button()
  595.     UsePen(NULL,1,0,0,0)
  596.     UseBrush(SOLID,192,192,192)
  597.     Drawrectangle( 530,10,750,200)
  598.     Goto Wait_for_Input
  599.  
  600.  
  601. Combiner:
  602.     TuneImage(0,0,0,0,0,0,Band8Handle)
  603.     CombineChannels(Band7Handle,Band3Handle,Band1Handle,Band8Handle,Res)
  604.     If Res = 0 Then MessageBox(OK,1,INFORMATION,"Combine Channel failed.","",Rss)
  605.     If Res <> 0 Then DrawNumber(200,0,Res)
  606.     DrawBitmap(30,38,Image8$)
  607.  
  608.     SaveBitmap("test.bmp", Res)
  609.  
  610.     GetBitMapDim("test.bmp",Lines,Pixels,Bits)
  611.     DrawText(25,0,Ext$)
  612.     DrawText(560,30,"Lines") DrawNumber(660,30,Lines)
  613.     DrawText(560,50,"Pixels") DrawNumber(660,50,Pixels)
  614.     DrawText(560,70,"Bits") DrawNumber(660,70,Bits)
  615.  
  616.     GetChannel(RED,RedHandle)
  617.     GetChannel(GREEN,GreenHandle)
  618.     GetChannel(BLUE,BlueHandle)
  619.     Goto Wait_for_Input
  620.  
  621. Noisy:
  622.     AddNoiseToImage(50,DISTRIBUTED,Res)
  623.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  624.     Goto Wait_for_Input
  625.  
  626. Cropper:
  627.     CropImage(20,20,180,220,Res)
  628.     If Res <> 0 
  629.         DrawBackGround
  630.         DrawBitmap(30,38,ImageFile$)
  631.     Endif
  632.     Goto Wait_for_Input
  633.  
  634. Resampler:
  635.     ResampleImage(300,300,NEAREST,Res)
  636.     If Res <> 0 
  637.         DrawBackGround
  638.         DrawBitMap(50,50,ImageFile$)
  639.     Endif
  640.     WaitInput(2000)
  641.     FreeBitMap(ImageFile$)
  642.     DrawBitMap(50,50,ImageFile$)
  643.     ResampleImage(300,300,BILINEAR,Res)
  644.     If Res <> 0 
  645.         DrawBackGround
  646.         DrawBitMap(50,50,ImageFile$)
  647.     Endif
  648.     WaitInput(2000)
  649.     FreeBitMap(ImageFile$)
  650.     DrawBitMap(50,50,ImageFile$)
  651.     ResampleImage(300,300,BICUBIC,Res)
  652.     If Res <> 0 
  653.         DrawBackGround
  654.         DrawBitMap(50,50,ImageFile$)
  655.     Endif
  656.     Goto Wait_for_Input
  657.  
  658. Resizer:
  659.     ResizeImage(200,200,Res)
  660.     If Res <> 0 
  661.         DrawBackGround
  662.         DrawBitMap(50,50,ImageFile$)
  663.     Endif
  664.     Goto Wait_for_Input
  665.  
  666. Cspace1:
  667.     DrawBitmap(30,38,ImageFile$)
  668.     UseCursor(WAIT)
  669.     ConvertColorSpace(RGB32,NONE,Res)
  670.     UseCursor(ARROW)
  671.     If Res = 0
  672.         MessageBox(OK,1,INFORMATION,"ConvertColorSpace failed.","",Res)
  673.     Else
  674.         DrawBitmap(30,38,ImageFile$)
  675.     Endif
  676.     Goto Wait_for_Input
  677. Cspace2:
  678.     DrawBitmap(30,38,ImageFile$)
  679.     UseCursor(WAIT)
  680.     ConvertColorSpace(RGB24,NONE,Res)
  681.     UseCursor(ARROW)
  682.     If Res = 0
  683.         MessageBox(OK,1,INFORMATION,"ConvertColorSpace failed.","",Res)
  684.     Else
  685.         DrawBitmap(30,38,ImageFile$)
  686.     Endif
  687.     Goto Wait_for_Input
  688. Cspace3:
  689.     DrawBitmap(30,38,ImageFile$)
  690.     UseCursor(WAIT)
  691.     ConvertColorSpace(RGB555,DIFFUSE,Res)
  692.     UseCursor(ARROW)
  693.     If Res = 0
  694.         MessageBox(OK,1,INFORMATION,"ConvertColorSpace failed.","",Res)
  695.     Else
  696.         DrawBitmap(30,38,ImageFile$)
  697.     Endif
  698.     Goto Wait_for_Input
  699. Cspace3a:
  700.     DrawBitmap(30,38,ImageFile$)
  701.     UseCursor(WAIT)
  702.     ConvertColorSpace(RGB565,DIFFUSE,Res)
  703.     UseCursor(ARROW)
  704.     If Res = 0
  705.         MessageBox(OK,1,INFORMATION,"ConvertColorSpace failed.","",Res)
  706.     Else
  707.         DrawBitmap(30,38,ImageFile$)
  708.     Endif
  709.     Goto Wait_for_Input
  710. Cspace4:
  711.     DrawBitmap(30,38,ImageFile$)
  712.     UseCursor(WAIT)
  713.     ConvertColorSpace(INDEXED,DIFFUSE,Res)
  714.     UseCursor(ARROW)
  715.     If Res = 0
  716.         MessageBox(OK,1,INFORMATION,"ConvertColorSpace failed.","",Res)
  717.     Else
  718.         DrawBitmap(30,38,ImageFile$)
  719.     Endif
  720.     Goto Wait_for_Input
  721. Cspace5:
  722.     DrawBitmap(30,38,ImageFile$)
  723.     UseCursor(WAIT)
  724.     ConvertColorSpace(GRAYSCALE,DIFFUSE,Res)
  725.     UseCursor(ARROW)
  726.     If Res = 0
  727.         MessageBox(OK,1,INFORMATION,"ConvertColorSpace failed.","",Res)
  728.     Else
  729.         DrawBitmap(30,38,ImageFile$)
  730.     Endif
  731.     Goto Wait_for_Input
  732.  
  733. Cspace6:
  734.     DrawBitmap(30,38,ImageFile$)
  735.     UseCursor(WAIT)
  736.     ConvertColorSpace(RGB48,DIFFUSE,Res)
  737.     UseCursor(ARROW)
  738.     If Res = 0
  739.         MessageBox(OK,1,INFORMATION,"ConvertColorSpace failed.","",Res)
  740.     Else
  741.         DrawBitmap(30,38,ImageFile$)
  742.     Endif
  743.     Goto Wait_for_Input
  744. Cspace7:
  745.     DrawBitmap(30,38,ImageFile$)
  746.     UseCursor(WAIT)
  747.     ConvertColorSpace(CMYK,DIFFUSE,Res)
  748.     UseCursor(ARROW)
  749.     If Res = 0
  750.         MessageBox(OK,1,INFORMATION,"ConvertColorSpace failed.","",Res)
  751.     Else
  752.         DrawBitmap(30,38,ImageFile$)
  753.     Endif
  754.     Goto Wait_for_Input
  755. Cspace8:
  756.     DrawBitmap(30,38,ImageFile$)
  757.     UseCursor(WAIT)
  758.     ConvertColorSpace(YCBCR,DIFFUSE,Res)
  759.     UseCursor(ARROW)
  760.     If Res = 0
  761.         MessageBox(OK,1,INFORMATION,"ConvertColorSpace failed.","",Res)
  762.     Else
  763.         DrawBitmap(30,38,ImageFile$)
  764.     Endif
  765.     Goto Wait_for_Input
  766. Cspace9:
  767.     DrawBitmap(30,38,ImageFile$)
  768.     UseCursor(WAIT)
  769.     ConvertColorSpace(CIELAB,DIFFUSE,Res)
  770.     UseCursor(ARROW)
  771.     If Res = 0
  772.         MessageBox(OK,1,INFORMATION,"ConvertColorSpace failed.","",Res)
  773.     Else
  774.         DrawBitmap(30,38,ImageFile$)
  775.     Endif
  776.     Goto Wait_for_Input
  777. Cspace10:
  778.     DrawBitmap(30,38,ImageFile$)
  779.     UseCursor(WAIT)
  780.     ConvertColorSpace(GRAY16,NONE,Res)
  781.     UseCursor(ARROW)
  782.     If Res = 0
  783.         MessageBox(OK,1,INFORMATION,"ConvertColorSpace failed.","",Res)
  784.     Else
  785.         DrawBitmap(30,38,ImageFile$)
  786.     Endif
  787.     Goto Wait_for_Input
  788. Cspace11:
  789.     DrawBitmap(30,38,ImageFile$)
  790.     UseCursor(WAIT)
  791.     ConvertColorSpace(MONO,NONE,Res)
  792.     UseCursor(ARROW)
  793.     If Res = 0
  794.         MessageBox(OK,1,INFORMATION,"ConvertColorSpace returned 0.","",Res)
  795.     Else
  796.         DrawBitmap(30,38,ImageFile$)
  797.     Endif
  798.     Goto Wait_for_Input
  799.  
  800. MakeHistogram:  {testing ... creates and deletes data buffes only}
  801.     If ImageFile$ = "" Then Goto Wait_for_Input
  802.     WaitInput(1)
  803.     ShowHistogram(ImageFile$,Res)
  804.     If Res = 0
  805.         MessageBox(OK,1,INFORMATION,"ShowHistogram returned 0.","PiXCL Test App",Res)
  806.     Endif
  807.     DrawBitmap(30,38,ImageFile$ )
  808.     TuneImage(0,0,0,0,0,0,BitmapHandle)
  809.     Histogram(820,100,POPUP,ImageFile$,BitmapHandle,NONCUM,"Gray", HistNumber1,
  810.           820,300,POPUP,ImageFile$,BitmapHandle,CUM,"Gray",HistNumber2)
  811.     Goto Wait_for_Input
  812.  
  813. Update_Histogram:
  814.     GetChannel(RED,RedHandle)
  815.     GetChannel(GREEN,GreenHandle)
  816.     GetChannel(BLUE,BlueHandle)
  817.  
  818.     UpdateHistogram(RedHandle,Histogram1,RECALC_CUM,Res)
  819.     UpdateHistogram(GreenHandle,Histogram2,RECALC_CUM,Res)
  820.     UpdateHistogram(BlueHandle,Histogram3,RECALC_CUM,Res)
  821.  
  822.     UpdateHistogram(RedHandle,HistNumber1,RECALC_CUM,Res)
  823.     UpdateHistogram(HistNumber2,RECALC_NONCUM,Res)
  824.  
  825.     Goto Wait_for_Input
  826.  
  827. Remove_Histogram:
  828.     Histogram()
  829.     HistNumber1 = 0
  830.     HistNumber2 = 0
  831.     Goto Wait_for_Input
  832.  
  833.  
  834. DisplacePixels:
  835.     ScatterPixels(20,Res)
  836.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  837.     Goto Wait_for_Input
  838.  
  839. Fast_Classify:
  840.     WaitInput(1)
  841.     If ImageFile$ <> ""
  842.         PaletteFile$ = SourceDir$ + "\vtheme.pal"
  843.         RemapImage(PaletteFile$,Res)
  844.        If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  845.     Endif
  846.     Goto Wait_for_Input
  847.  
  848. ImageRemapper:
  849.     WaitInput(1)
  850.     If ImageFile$ <> ""
  851.         PaletteFile$ = SourceDir$ + "\negmap.pal"
  852.         RemapImage(PaletteFile$,Res)
  853.         If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  854.     Endif
  855.     Goto Wait_for_Input
  856.  
  857. ImageRotation:
  858.     WaitInput(1)
  859.     RotateImage(11,Res)
  860.     xx2 = sx2 - 2 
  861.     yy2 = sy2 - 2
  862.     {If Res <> 0 Then DrawSizedBitMap(30,38,xx2,yy2,ImageFile$)}
  863.     If Res <> 0 Then DrawBitMap(30,38,ImageFile$)
  864.     Goto Wait_for_Input
  865.  
  866. ImageRotationExt:
  867.     WaitInput(1)
  868.     xx2 = sx2 - 2 
  869.     yy2 = sy2 - 2
  870.     SetMouse(30,38,xx2,yy2,GetRotationPoint,rx,ry)
  871.     UseCursor(CROSSHAIR)
  872.     WaitInput()
  873. GetRotationPoint:
  874.     SetMouse()
  875.     UseCursor(WAIT)
  876.     { Correct client coords to image coords, and invert the Y coord because of the 
  877.           way bitmaps are stored.
  878.     }
  879.     rrx = rx -30
  880.     rry = ry - 38  rry = 406 - rry
  881.     RotateImageExt(rrx,rry,11,BICUBIC,Res)
  882.     UseCursor(ARROW)
  883.     If Res <> 0
  884.         {DrawSizedBitMap(30,38,xx2,yy2,ImageFile$)}
  885.         DrawBitMap(30,38,ImageFile$)
  886.         UsePen(SOLID,1,255,0,0)
  887.         UseBrush(NULL,0,0,0)
  888.         DrawPoint(rx,ry,CIRCLE)
  889.     Else
  890.         MessageBox(OK,1,EXCLAMATION, "RotateImageEx Failed","",Res)
  891.     Endif
  892.     Goto Wait_for_Input
  893.  
  894.  
  895.  
  896. SkewerV:
  897.     SkewImage(17,VERT,Res)
  898.     xx2 = sx2 - 2 
  899.     yy2 = sy2 - 2
  900.     If Res <> 0 Then DrawSizedBitMap(30,38,xx2,yy2,ImageFile$)
  901.      Goto Wait_for_Input
  902.  
  903. SkewerH:
  904.     SkewImage(17,HORZ,Res)
  905.     xx2 = sx2 - 2 
  906.     yy2 = sy2 - 2
  907.     If Res <> 0 Then DrawSizedBitMap(30,38,xx2,yy2,ImageFile$)
  908.      Goto Wait_for_Input
  909.  
  910. BrightnessContrastUp:
  911.     Count = 0
  912.     While Count < 10
  913.         TuneImage(10,10,10,5,5,5,Res)
  914.         Count++
  915.         If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  916.     EndWhile
  917.      Goto Wait_for_Input
  918.  
  919. BrightnessContrastDn:
  920.     Count = 0
  921.     While Count < 10
  922.         TuneImage(-10,-10,-10,-5,-5,-5,Res)
  923.         Count++
  924.         If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  925.     EndWhile
  926.      Goto Wait_for_Input
  927.  
  928. Equalizer:
  929.     WaitInput(1)
  930.     EqualizeImage(Res)
  931.     GetListBitmapDim(ImageFile$,L,P,Bits)
  932.     GetChannel(RED,BitmapChannel)
  933.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)     UpdateHistogram(BitmapChannel,HistID,RECALC_NONCUM,Res)
  934.      Goto Wait_for_Input
  935.  
  936. Normalizer:
  937.     WaitInput(1)
  938.     NormalizeImage(Res)
  939.     GetListBitmapDim(ImageFile$,L,P,Bits)
  940.         GetChannel(RED,BitmapChannel)
  941.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)     UpdateHistogram(BitmapChannel,HistID,RECALC_NONCUM,Res)
  942.      Goto Wait_for_Input
  943.  
  944. NormalizerRange:
  945.     WaitInput(1)
  946.     NormalizeImageRange(20,220,Res)
  947.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  948.      Goto Wait_for_Input
  949.  
  950. Despecker:
  951.     WaitInput(1)
  952.     DespeckleImage(50,Res)
  953.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  954.      Goto Wait_for_Input
  955.  
  956. FlipVertical:
  957.     WaitInput(1)
  958.     FlipImage(VERT,Res)
  959.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  960.      Goto Wait_for_Input
  961.  
  962.  
  963. FlipHorizontal:
  964.     WaitInput(1)
  965.     FlipImage(HORZ,Res)
  966.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  967.      Goto Wait_for_Input
  968.  
  969. Inversion:
  970.     WaitInput(1)
  971.     InvertImage(Res)
  972.     GetListBitmapDim(ImageFile$,L,P,Bits)
  973.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$) 
  974.     GetChannel(RED,BitmapChannel)
  975.     UpdateHistogram(BitmapChannel,HistID,RECALC_NONCUM,Res)
  976.      Goto Wait_for_Input
  977.  
  978. Embossing:
  979.     EmbossImage(4,Res)
  980.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  981.      Goto Wait_for_Input
  982.  
  983. EdgeDetect:
  984.     EdgeDetectImage(Res)
  985.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  986.      Goto Wait_for_Input
  987.  
  988. Averaging:
  989.     AverageImage(60,Res)
  990.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  991.      Goto Wait_for_Input
  992. Blurring:
  993.     BlurImage(90,Res)
  994.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  995.      Goto Wait_for_Input
  996.  
  997. GBlurring:
  998.     UseCursor(WAIT)
  999.     GaussianBlurImage(90,Res)
  1000.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  1001.     TuneImage(0,0,0,0,0,0,BitmapHandle)
  1002.     Histogram(600,40,POPUP,ImageFile$, BitmapHandle ,NONCUM,"90% blur",HistID)
  1003.     UseCursor(ARROW)
  1004.      Goto Wait_for_Input
  1005.  
  1006. Sharpening:
  1007.     SharpenImage(10,Res)
  1008.     If Res <> 0 Then DrawBitmap(30,38,ImageFile$)
  1009.      Goto Wait_for_Input
  1010.  
  1011. HelpGetImageInfo:
  1012.     MessageBox(OK,1,INFORMATION,
  1013. "Select an image file and get the parameters:
  1014. pixels per line, lines, bits per pixel. Image 
  1015. can be optionally displayed.",
  1016.     "Get supported bitmap image parameters.",Res)
  1017.     Goto Wait_for_Input
  1018.  
  1019. HelpPaint:
  1020.     MessageBox(OK,1,INFORMATION,
  1021. "Paint the test BMP, JPG, PCX, PNG, RAS, 
  1022. TGA and TIF images cascaded across the client area.",
  1023.     "Painting an image.",Res)
  1024.     Goto Wait_for_Input
  1025.  
  1026.  
  1027. Clear:
  1028.     DrawBackGround
  1029.     Goto Wait_for_Input
  1030. ClearAll:
  1031.     DrawBackGround
  1032.     StatusWindow(ENABLE,BOTTOM,4,290,390,490,-1)
  1033.     FreeBitMapAll
  1034.     ImageFile$ = "" { could also use FreeVar(imageFile$) }
  1035.     Goto Wait_for_Input
  1036.     
  1037. Test:
  1038.     Goto Wait_for_Input
  1039.     
  1040. Create_PiXCL_Toolwindow:
  1041.     Toolbar(RAISED,  
  1042.         PXL_SMALL, 
  1043.         NULL, NULL, SEPARATOR, "", Test,
  1044.  
  1045.         NEW, ENABLED, STD, "FileNew", Test,
  1046.         OPEN, ENABLED, STD, "FileOpen", GetImageInfo,
  1047.         SAVE, ENABLED, STD, "FileSave", SaveImageInfo,
  1048.  
  1049.         NULL, NULL, SEPARATOR, "", Test,
  1050.         NULL, NULL, SEPARATOR, "", Test,
  1051.  
  1052.         CUT,  ENABLED, CHECK_G, "Edit: Cut", Test, 
  1053.         COPY ,  ENABLED, CHECK_G, "Edit: Copy", Test,
  1054.         PASTE,  ENABLED, CHECK_G, "Edit: Paste", Test, 
  1055.         DELETE,  ENABLED, CHECK_G, "Edit: Delete", Test, 
  1056.         REPLACE, ENABLED,CHECK_G,"Edit: Replace",Test,
  1057.         REDO,  ENABLED, STD, "Redo", Test, 
  1058.         UNDO,  ENABLED, STD, "Undo", UndoLastOperation, 
  1059.         PRINT,  ENABLED, STD, "Print", Test, 
  1060.  
  1061.         NULL, NULL, SEPARATOR, "", Test,
  1062.  
  1063.         FIND,  ENABLED, STD, "Find", Test, 
  1064.         PROP, ENABLED, STD,"Properties", Test,
  1065.         PPREV,  ENABLED, STD, "Print Preview", Test, 
  1066.         HELPINFO,  ENABLED, STD, "Show Help", Test) 
  1067.  
  1068.     ToolWindow( 510,150,613,424,POPUP,"PiXCL 4.4", 
  1069.         RAISED, PXL_LARGE,              
  1070.         ANNOT,  ENABLED, STD, "Annotation", Test,    
  1071.         SQSELECT,  ENABLED, STD, "Select", Test,
  1072.         POLYSELECT,  ENABLED, STD, "PolySelect", Test,
  1073.         ERASE,  ENABLED, STD, "Clear All Images", ClearAll,
  1074.         OPENIMAGE,  ENABLED, STD, "Get Bitmap Info", GetImageInfo,
  1075.         HISTOGRAM,  ENABLED, STD, "Histogram",MakeHistogram,
  1076.         MIRROR,  ENABLED, STD, "Image Mirror",FlipHorizontal,
  1077.         FLIP,  ENABLED, STD, "Image Flip", FlipVertical,
  1078.         ROTATE,  ENABLED, STD, "Image Rotate", ImageRotation,
  1079.         SHOWRGB,  ENABLED, STD, "Tune Down", BrightnessContrastDn,
  1080.         PICKRGB,  ENABLED, STD, "Pick RGB", Test,
  1081.         CLASSIFY,  ENABLED, STD, "Overlays", OverlayThemes, 
  1082.         NORMALIZE,  ENABLED, STD, "Normalize Image", Normalizer,
  1083.         EQUALIZE,  ENABLED, STD, "Equalize Image", Equalizer,
  1084.         NEGATIVE,  ENABLED, STD, "Negative Image", Inversion,
  1085.         GAMMACRCT,  ENABLED, STD, "Gamma Correct", Test,
  1086.         IMAGEINFO,  ENABLED, STD, "ImageInfo", CountTheList,
  1087.         FINGER,  ENABLED, STD, "Finger", Test,
  1088.         HAND,  ENABLED, STD, "Hand", Test,
  1089.         FLOOD,  ENABLED, STD, "Flood", Test,
  1090.         SPRAY,  ENABLED, STD, "Spray", Test,
  1091.         ZOOMUP,  ENABLED, STD, "Positive Zoom", PosZoom,
  1092.         ZOOMDN,  ENABLED, STD, "Negative Zoom", NegZoom,
  1093.         BRUSH,  ENABLED, STD, "Brush", Test)
  1094.  
  1095.     WinSetActive(Title$,Res)
  1096.     Return
  1097.  
  1098.